home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Amiga Format CD 51
/
Amiga Format CD51 (2000-03-10)(Future Publishing)(GB)[!][issue 2000-04].iso
/
-serious-
/
programming
/
other
/
sx4amiga
/
flashing_leds.lst
< prev
next >
Wrap
File List
|
2000-01-27
|
11KB
|
260 lines
#PIC V1.0 (c)1997 J.Petroglou LIST FILE
#file: flashing_leds.asm
#date: Mon Jan 10 15:59:51 2000
#pic : PIC16C57
ADDR CODE SRCLINE SOURCECODE
0000 000001 ;FLASHING LEDS
0000 000002 ;Example code for SX28 processor
0000 000003 ;This code flashes leds on and off on all I/O lines (RA,RB,RC)
0000 000004
0000 000005 ;PROCESSOR=SX28AC
0000 000006 ;FUSE=0xE0B
0000 000007 ;FUSEX=0xFFF
0000 000008
0000 000009
0000 000010 ;NOTE1: The processor,fuse and fusex settings are not taken over by the programmer
0000 000011 ; but must be entered manually on programming time
0000 000012
0000 000013 ;NOTE2: The programmer will ignore bits 11:7 of FUSEX. ITis therefore perfectly
0000 000014 ; possible that a value different from the one you specified will be
0000 000015 ; programmed into the SX chip.
0000 000016
0000 000017
0000 000018
0000 000019
0000 000020 ;Variables
0000 000021
0000 000022 countA equ 0x08
0000 000023 countB equ 0x09
0000 000024
0000 000025
0000 000026
0000 000027
#include 'SX.inc' start
0000 000001 ;Include File for the SX chips form Scenix
0000 000002 ;for use with PicASM from the Apic package
0000 000003 ;It sets the processor to PIC16C57 which is (almost) code-compatible
0000 000004 ;
0000 000005 ;(12-bit CORE)
0000 000006
0000 000007
0000 000008 ;W and F contstants
0000 000009
0000 000010 W EQU H'0000'
0000 000011 F EQU H'0001'
0000 000012
0000 000013 ;Special Function Registers
0000 000014
0000 000015 INDF equ 0x00
0000 000016 RTCC equ 0x01
0000 000017 PC equ 0x02
0000 000018 STATUS equ 0x03
0000 000019 FSR equ 0x04
0000 000020 RA equ 0x05
0000 000021 RB equ 0x06
0000 000022 RC equ 0x07
0000 000023
0000 000024 ;STATUS bits
0000 000025
0000 000026 C equ 0
0000 000027 DC equ 1
0000 000028 Z equ 2
0000 000029 NOT_PD equ 3
0000 000030 NOT_TO equ 4
0000 000031 PA0 equ 5
0000 000032 PA1 equ 6
0000 000033 PA2 equ 7
0000 000034
0000 000035 ;OPTION bits
0000 000036
0000 000037 PSO equ 0
0000 000038 PS1 equ 1
0000 000039 PS2 equ 2
0000 000040 PSA equ 3
0000 000041 RTE_ES equ 4
0000 000042 RTS equ 5
0000 000043 RTE_IE equ 6
0000 000044 RTW equ 7
0000 000045
0000 000046
0000 000047
0000 000048 ;bank switch macro's
0000 000049
0000 000050 macro BANK0
0000 000051 bcf STATUS,PA0
0000 000052 bcf STATUS,PA1
0000 000053 endm
0000 000054
0000 000055 macro BANK1
0000 000056 bsf STATUS,PA0
0000 000057 bcf STATUS,PA1
0000 000058 endm
0000 000059
0000 000060 macro BANK2
0000 000061 bcf STATUS,PA0
0000 000062 bsf STATUS,PA1
0000 000063 endm
0000 000064
0000 000065 macro BANK3
0000 000066 bsf STATUS,PA0
0000 000067 bsf STATUS,PA1
0000 000068 endm
0000 000069
0000 000071
0000 000072 macro mode
0000 000073 bcf 0x02,1 ;MODE
0000 000074 endm
0000 000075
0000 000076 macro ret
0000 000077 bcf 0x02,2 ;RET
0000 000078 endm
0000 000079
0000 000080 macro reti
0000 000081 bcf 0x02,3 ;RETI
0000 000082 endm
0000 000083
0000 000085
0000 000086 PROCESSOR pic16c57
0000 000087
#include end.
0000 000029
0000 000030
0000 000031
0000 000032 org 0x000
0000 000033
0000 0C00 000034 Start movlw 0x00 ; set DDR/TRIS register
0001 0005 000035 tris RA ; (all ports output)
0002 0006 000036 tris RB
0003 0007 000037 tris RC
0004 000038
0004 0C0F 000039 Loop movlw 0x0f ; All I/O lines HIGH
0005 0025 000040 movwf RA
0006 0CFF 000041 movlw 0xff
0007 0026 000042 movwf RB
0008 0CFF 000043 movlw 0xff
0009 0027 000044 movwf RC
000A 000045
000A 0911 000046 call Delay
000B 000047
000B 0C00 000048 movlw 0x00 ; All I/O lines LOW
000C 0025 000049 movwf RA
000D 0026 000050 movwf RB
000E 0027 000051 movwf RC
000F 000052
000F 0911 000053 call Delay
0010 000054
0010 0A04 000055 goto Loop
0011 000056
0011 000057
0011 000058
0011 000059
0011 000060
0011 000061
0011 000062
0011 000063
0011 000064
0011 0000 000065 Delay nop ; Double Delay Loop
0012 02E9 000066 decfsz countB
0013 0A11 000067 goto Delay
0014 000068
0014 02E8 000069 decfsz countA
0015 0A11 000070 goto Delay
0016 000071
0016 0442 000072 bcf 0x02,2 ;RET
0017 000073
0017 000074
0017 000075
0017 000076
0017 000077
0017 000078
07FF 000079 org 0x7ff ; RESET vector
07FF 000080
07FF 0A00 000081 goto Start
0800 000082
0800 000083
0800 000084
0800 000085
Used Symbols
-----------------------------------------
countA 00000008
countB 00000009
W 00000000
F 00000001
INDF 00000000
RTCC 00000001
PC 00000002
STATUS 00000003
FSR 00000004
RA 00000005
RB 00000006
RC 00000007
C 00000000
DC 00000001
Z 00000002
NOT_PD 00000003
NOT_TO 00000004
PA0 00000005
PA1 00000006
PA2 00000007
PSO 00000000
PS1 00000001
PS2 00000002
PSA 00000003
RTE_ES 00000004
RTS 00000005
RTE_IE 00000006
RTW 00000007
Start 00000000
Loop 00000004
Delay 00000011
Used Defines
-----------------------------------------
PROGRAM MEMORY USAGE TABLE: '-' = not used 'X' = used
0000 : XXXXXXXXXXXXXXXX XXXXXXX--------- ---------------- ----------------
0040 : ---------------- ---------------- ---------------- ----------------
0080 : ---------------- ---------------- ---------------- ----------------
00C0 : ---------------- ---------------- ---------------- ----------------
0100 : ---------------- ---------------- ---------------- ----------------
0140 : ---------------- ---------------- ---------------- ----------------
0180 : ---------------- ---------------- ---------------- ----------------
01C0 : ---------------- ---------------- ---------------- ----------------
0200 : ---------------- ---------------- ---------------- ----------------
0240 : ---------------- ---------------- ---------------- ----------------
0280 : ---------------- ---------------- ---------------- ----------------
02C0 : ---------------- ---------------- ---------------- ----------------
0300 : ---------------- ---------------- ---------------- ----------------
0340 : ---------------- ---------------- ---------------- ----------------
0380 : ---------------- ---------------- ---------------- ----------------
03C0 : ---------------- ---------------- ---------------- ----------------
0400 : ---------------- ---------------- ---------------- ----------------
0440 : ---------------- ---------------- ---------------- ----------------
0480 : ---------------- ---------------- ---------------- ----------------
04C0 : ---------------- ---------------- ---------------- ----------------
0500 : ---------------- ---------------- ---------------- ----------------
0540 : ---------------- ---------------- ---------------- ----------------
0580 : ---------------- ---------------- ---------------- ----------------
05C0 : ---------------- ---------------- ---------------- ----------------
0600 : ---------------- ---------------- ---------------- ----------------
0640 : ---------------- ---------------- ---------------- ----------------
0680 : ---------------- ---------------- ---------------- ----------------
06C0 : ---------------- ---------------- ---------------- ----------------
0700 : ---------------- ---------------- ---------------- ----------------
0740 : ---------------- ---------------- ---------------- ----------------
0780 : ---------------- ---------------- ---------------- ----------------
07C0 : ---------------- ---------------- ---------------- ---------------X
Program Memory Words Used: 0024
Program Memory Words Free: 2024
Errors: 0